#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 2020/7/24 下午4:42
# @Author : admin
# @Software: PyCharm
# @File: schedule.py

from apscheduler.jobstores.redis import RedisJobStore
from apscheduler.schedulers.background import BlockingScheduler

from tasks import set_inspect

jobstores = {
    'default': RedisJobStore()
}

scheduler = BlockingScheduler(jobstores=jobstores)
# scheduler.add_job(set_inspect, 'cron', minute=59, hour=23,day="*", replace_existing=True)
scheduler.add_job(set_inspect, 'interval', minutes=180, id='set_inspect', replace_existing=True)
scheduler.start()
